package com.ubxtech.rocketmq.callback;

import com.alibaba.fastjson2.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.client.producer.SendCallback;
import org.apache.rocketmq.client.producer.SendResult;

/**
 * @author Victor.Xiao
 * @since 2023-11-28 19:49
 **/
@Slf4j
public class SendCallbackListener implements SendCallback {
    @Override
    public void onSuccess(SendResult sendResult) {
        log.info("SendCallbackListener on success : " + JSONObject.toJSONString(sendResult));
    }

    @Override
    public void onException(Throwable throwable) {
        log.error("SendCallbackListener on exception : ", throwable);
    }
}
